<div style="clear:both">&nbsp;</div>
<div class="texto-geral" style="text-align:justify; margin-right:10px">

<?php
$cuponsUser  			= $_cli->pegaCupon($rowcliente["id"],0); 
$cuponsUserUsado  	= $_cli->pegaCupon($rowcliente["id"],1); 



if(count($cuponsUser)==0){

echo "Você não tem cupons cadastrados.";

}else{
?>

<table width="100%" cellpadding="5" cellspacing="5">
 <tr bgcolor="<?=$corfundo?>">
   <td colspan="3" align="left" bgcolor="#F8F8F8"><h2>Cupons novos</h2></td>
   </tr>
 <tr bgcolor="<?=$corfundo?>">
   <td align="left"><strong>E-mail</strong></td>
   <td><strong>Valor</strong></td>
 </tr>
 
<?
$x	=0;
$valor	= 0;
foreach($cuponsUser as $cp){ 
$x%2 == 0?$corfundo = "#FFFFFF":$corfundo = "#f2f2f2";
$valor	= $valor	+	$cp["desconto"];
?>

 <tr bgcolor="<?=$corfundo?>">
      <td width="52%" align="left"><?=$cp["email_amigo"]?></td>
      <td width="46%">
      R$<?=$cp["desconto"]?>
      </td>
    </tr>
<? $x++; } ?> </table> <? } ?>

<table width="100%" cellpadding="5" cellspacing="5">
 <tr bgcolor="<?=$corfundo?>">
      <td width="52%" align="left"><b>TOTAL</b></td>
      <td width="46%">
     <span style="font-size:16px; color:#FF0000">R$<?=$valor?></span>
      </td>
    </tr>
 
  <tr bgcolor="<?=$corfundo?>">
      <td colspan="2">
     <span style="color:#FF0000"><a href="http://www.gncsuplementos.com.br/conteudo.php?pagina=fale-conosco">Clique aqui</a> Peça seu resgate via e-mail. contato@gncsuplementos.com.br</span>
      </td>
    </tr>
 
   
</table>



<?php
if(count($cuponsUserUsado)==0){
#NAO TEM CUPON USADO!
}else{
?>

<div style="clear:both">&nbsp;</div>
<br />

<div style="clear:both">&nbsp;</div>
<table width="100%" cellpadding="5" cellspacing="5">
 <tr bgcolor="<?=$corfundo?>">
   <td colspan="3" align="left" bgcolor="#F8F8F8"><h2>Cupons usados</h2></td>
   </tr>
 <tr bgcolor="<?=$corfundo?>">
   <td align="left"><strong>ID</strong></td>
   <td align="left"><strong>Número do cupom</strong></td>
   <td><strong>Desconto</strong></td>
 </tr>
 
<?
$x	=0;
foreach($cuponsUserUsado as $cpu){ 
$y%2 == 0?$corfundo = "#FFFFFF":$corfundo = "#f2f2f2";
?>

 <tr bgcolor="<?=$corfundo?>">
   <td width="2%" align="left"><?=$cpu["id"]?></td>
      <td width="52%" align="left"><?=$cpu["numero"]?></td>
      <td width="46%">
      <?=$cpu["desconto"]?>%
      </td>
    </tr>
<? $y++; } ?> </table> <? } ?>




</div>